<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Get aliases of a known encoding type</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.mb-encode-numericentity.html">mb_encode_numericentity</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.mb-ereg-match.html">mb_ereg_match</a></div>
 <div class="up"><a href="ref.mbstring.html">多字节字符串 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.mb-encoding-aliases" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mb_encoding_aliases</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.0)</p><p class="refpurpose"><span class="refname">mb_encoding_aliases</span> &mdash; <span class="dc-title">Get aliases of a known encoding type</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.mb-encoding-aliases-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">array</span> <span class="methodname"><strong>mb_encoding_aliases</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$encoding</code></span>
   )</div>

  <p class="para rdfs-comment">
   Returns an array of aliases for a known <em><code class="parameter">encoding</code></em> type.
  </p>
 </div>

 
 <div class="refsect1 parameters" id="refsect1-function.mb-encoding-aliases-parameters">
  <h3 class="title">参数</h3>
  <dl>

   
    <dt>
<em><code class="parameter">encoding</code></em></dt>

    <dd>

     <p class="para">
      The encoding type being checked, for aliases.
     </p>
    </dd>

   
  </dl>

 </div>

 
 <div class="refsect1 returnvalues" id="refsect1-function.mb-encoding-aliases-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns a numerically indexed array of encoding aliases on success,
    或者在失败时返回 <strong><code>FALSE</code></strong>
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.mb-encoding-aliases-errors">
  <h3 class="title">错误／异常</h3>
  <p class="para">
   Emits an <strong><code>E_WARNING</code></strong> level error if
   <em><code class="parameter">encoding</code></em> is unknown.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.mb-encoding-aliases-examples">
  <h3 class="title">范例</h3>
  <div class="example" id="example-2646">
   <p><strong>Example #1 <span class="function"><strong>mb_encoding_aliases()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$encoding&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'ASCII'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$known_encodings&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mb_list_encodings</span><span style="color: #007700">();<br /><br />if&nbsp;(</span><span style="color: #0000BB">in_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$encoding</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$known_encodings</span><span style="color: #007700">))&nbsp;{<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$aliases&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mb_encoding_aliases</span><span style="color: #007700">(</span><span style="color: #0000BB">$encoding</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$aliases</span><span style="color: #007700">);<br /><br />}&nbsp;else&nbsp;{<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Unknown&nbsp;(</span><span style="color: #0000BB">$encoding</span><span style="color: #DD0000">)&nbsp;encoding.\n"</span><span style="color: #007700">;<br /><br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
   </div>

   <div class="example-contents"><p>以上例程的输出类似于：</p></div>
   <div class="example-contents screen">
<div class="cdata"><pre>
Array
(
    [0] =&gt; ANSI_X3.4-1968
    [1] =&gt; iso-ir-6
    [2] =&gt; ANSI_X3.4-1986
    [3] =&gt; ISO_646.irv:1991
    [4] =&gt; US-ASCII
    [5] =&gt; ISO646-US
    [6] =&gt; us
    [7] =&gt; IBM367
    [8] =&gt; cp367
    [9] =&gt; csASCII
)
</pre></div>
   </div>
  </div>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-function.mb-encoding-aliases-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.mb-list-encodings.html" class="function" rel="rdfs-seeAlso">mb_list_encodings()</a> - 返回所有支持编码的数组</span></li>
   </ul>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.mb-encode-numericentity.html">mb_encode_numericentity</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.mb-ereg-match.html">mb_ereg_match</a></div>
 <div class="up"><a href="ref.mbstring.html">多字节字符串 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
